import Vue from 'vue';
import Vuex from 'vuex';
import getters from './getters';
import mutations from './mutations';
import actions from './actions';
// import { getStore, setStore } from '../common/util';

Vue.use(Vuex);

const state = {
  userInfo: null, // 用户信息,
};


// const storeState = store => {
//     store.subscribe((mutation) => {
//         if (mutation.type === 'CHANGE_CITY') {
//             setStore('defautCity', mutation.payload);
//         }
//     });
// };

export default new Vuex.Store({
  state,
  getters,
  actions,
  mutations,
  // plugins: [storeState],
});
